home *** CD-ROM | disk | FTP | other *** search
/ Sprite 1984 - 1993 / Sprite 1984 - 1993.iso / src / lib / include / RCS / tzfile.h,v < prev    next >
Encoding:
Text File  |  1988-07-02  |  2.7 KB  |  125 lines

  1. head     1.1;
  2. access   ;
  3. symbols  ;
  4. locks    ; strict;
  5. comment  @ * @;
  6.  
  7.  
  8. 1.1
  9. date     88.07.02.14.57.54;  author ouster;  state Exp;
  10. branches ;
  11. next     ;
  12.  
  13.  
  14. desc
  15. @@
  16.  
  17.  
  18.  
  19. 1.1
  20. log
  21. @Initial revision
  22. @
  23. text
  24. @/*
  25.  *    @@(#)tzfile.h    5.2 tzfile.h 3/4/87
  26.  */
  27.  
  28. /*
  29. ** Information about time zone files.
  30. */
  31.  
  32. #define    TZDIR        "/etc/zoneinfo"    /* Time zone object file directory */
  33. #define    TZDEFAULT    "localtime"
  34.  
  35. /*
  36. ** Each file begins with. . .
  37. */
  38.  
  39. struct tzhead {
  40.     char    tzh_reserved[32];    /* reserved for future use */
  41.     char    tzh_timecnt[4];        /* coded number of transition times */
  42.     char    tzh_typecnt[4];        /* coded number of local time types */
  43.     char    tzh_charcnt[4];        /* coded number of abbr. chars */
  44. };
  45.  
  46. /*
  47. ** . . .followed by. . .
  48. **
  49. **    tzh_timecnt (char [4])s        coded transition times a la time(2)
  50. **    tzh_timecnt (unsigned char)s    types of local time starting at above
  51. **    tzh_typecnt repetitions of
  52. **        one (char [4])        coded GMT offset in seconds
  53. **        one (unsigned char)    used to set tm_isdt
  54. **        one (unsigned char)    that's an abbreviation list index
  55. **    tzh_charcnt (char)s        '\0'-terminated zone abbreviaton strings
  56. */
  57.  
  58. /*
  59. ** In the current implementation, "tzset()" refuses to deal with files that
  60. ** exceed any of the limits below.
  61. */
  62.  
  63. /*
  64. ** The TZ_MAX_TIMES value below is enough to handle a bit more than a
  65. ** year's worth of solar time (corrected daily to the nearest second) or
  66. ** 138 years of Pacific Presidential Election time
  67. ** (where there are three time zone transitions every fourth year).
  68. */
  69. #define    TZ_MAX_TIMES    370
  70.  
  71. #define    NOSOLAR            /* We currently don't handle solar time */
  72.  
  73. #ifndef    NOSOLAR
  74. #define    TZ_MAX_TYPES    256    /* Limited by what (unsigned char)'s can hold */
  75. #else /* !NOSOLAR */
  76. #define    TZ_MAX_TYPES    10    /* Maximum number of local time types */
  77. #endif /* !NOSOLAR */
  78.  
  79. #define    TZ_MAX_CHARS    50    /* Maximum number of abbreviation characters */
  80.  
  81. #define    SECS_PER_MIN    60
  82. #define    MINS_PER_HOUR    60
  83. #define    HOURS_PER_DAY    24
  84. #define    DAYS_PER_WEEK    7
  85. #define    DAYS_PER_NYEAR    365
  86. #define    DAYS_PER_LYEAR    366
  87. #define    SECS_PER_HOUR    (SECS_PER_MIN * MINS_PER_HOUR)
  88. #define    SECS_PER_DAY    ((long) SECS_PER_HOUR * HOURS_PER_DAY)
  89. #define    MONS_PER_YEAR    12
  90.  
  91. #define    TM_SUNDAY    0
  92. #define    TM_MONDAY    1
  93. #define    TM_TUESDAY    2
  94. #define    TM_WEDNESDAY    3
  95. #define    TM_THURSDAY    4
  96. #define    TM_FRIDAY    5
  97. #define    TM_SATURDAY    6
  98.  
  99. #define    TM_JANUARY    0
  100. #define    TM_FEBRUARY    1
  101. #define    TM_MARCH    2
  102. #define    TM_APRIL    3
  103. #define    TM_MAY        4
  104. #define    TM_JUNE        5
  105. #define    TM_JULY        6
  106. #define    TM_AUGUST    7
  107. #define    TM_SEPTEMBER    8
  108. #define    TM_OCTOBER    9
  109. #define    TM_NOVEMBER    10
  110. #define    TM_DECEMBER    11
  111. #define    TM_SUNDAY    0
  112.  
  113. #define    TM_YEAR_BASE    1900
  114.  
  115. #define    EPOCH_YEAR    1970
  116. #define    EPOCH_WDAY    TM_THURSDAY
  117.  
  118. /*
  119. ** Accurate only for the past couple of centuries;
  120. ** that will probably do.
  121. */
  122.  
  123. #define    isleap(y) (((y) % 4) == 0 && ((y) % 100) != 0 || ((y) % 400) == 0)
  124. @
  125.